package com.galaxis.wms.query

import com.querydsl.core.types.Path
import com.querydsl.core.types.PathMetadata
import com.querydsl.core.types.dsl.DateTimePath
import com.querydsl.core.types.dsl.NumberPath
import com.querydsl.core.types.dsl.StringPath
import com.querydsl.sql.ColumnMetadata
import com.querydsl.sql.RelationalPathBase
import com.yvan.studio.model.entity.SysResource

import java.sql.Timestamp
import java.sql.Types

import static com.querydsl.core.types.PathMetadataFactory.forVariable

/**
 * 系统资源表(sys_resource)
 */
@SuppressWarnings("ALL")
class QSysResource extends RelationalPathBase<SysResource> {
    /** sys_resource表 */
    public static final QSysResource sysResource = new QSysResource("sys_resource")

    /** 资源ID */
    public final NumberPath<Long> resourceId = createNumber("resourceId", Long.class)
    /** 资源名称 */
    public final StringPath resourceName = createString("resourceName")
    /** 上级资源名称 */
    public final NumberPath<Long> resourceParent = createNumber("resourceParent", Long.class)
    /** 资源类型 */
    public final NumberPath<Integer> resourceType = createNumber("resourceType", Integer.class)
    /** 资源图标 */
    public final StringPath resourceIcon = createString("resourceIcon")
    /** 功能URL */
    public final StringPath scopeUrl = createString("scopeUrl")
    /** 功能参数 */
    public final StringPath scopeParams = createString("scopeParams")
    /** 资源排序 */
    public final NumberPath<Integer> resourceOrder = createNumber("resourceOrder", Integer.class)
    /** 权限编码 */
    public final StringPath permissionCode = createString("permissionCode")
    /** 是否可用于用户关联 */
    public final NumberPath<Integer> isUserRelation = createNumber("isUserRelation", Integer.class)
    /** 是否可用于角色关联 */
    public final NumberPath<Integer> isRoleRelation = createNumber("isRoleRelation", Integer.class)
    /** 是否可用 */
    public final NumberPath<Integer> isEnable = createNumber("isEnable", Integer.class)
    /** 创建人 */
    public final StringPath createBy = createString("createBy")
    /** 创建时间 */
    public final DateTimePath<Timestamp> createAt = createDateTime("createAt", Timestamp.class)
    /** 更新人 */
    public final StringPath updateBy = createString("updateBy")
    /** 更新时间 */
    public final DateTimePath<Timestamp> updateAt = createDateTime("updateAt", Timestamp.class)

    QSysResource(String variable) {
        super(SysResource.class, forVariable(variable), "public", "sys_resource")
        addMetadata()
    }

    QSysResource(String variable, String schema, String table) {
        super(SysResource.class, forVariable(variable), schema, table)
        addMetadata()
    }

    QSysResource(String variable, String schema) {
        super(SysResource.class, forVariable(variable), schema, "sys_resource")
        addMetadata()
    }

    QSysResource(Path<? extends SysResource> path) {
        super(path.getType(), path.getMetadata(), "public", "sys_resource")
        addMetadata()
    }

    QSysResource(PathMetadata metadata) {
        super(SysResource.class, metadata, "public", "sys_resource")
        addMetadata()
    }

    void addMetadata() {
        addMetadata(resourceId, ColumnMetadata.named("resource_id").withIndex(1).ofType(Types.BIGINT).withSize(19))
        addMetadata(resourceName, ColumnMetadata.named("resource_name").withIndex(2).ofType(Types.VARCHAR).withSize(255))
        addMetadata(resourceParent, ColumnMetadata.named("resource_parent").withIndex(3).ofType(Types.BIGINT).withSize(19))
        addMetadata(resourceType, ColumnMetadata.named("resource_type").withIndex(4).ofType(Types.INTEGER).withSize(10))
        addMetadata(resourceIcon, ColumnMetadata.named("resource_icon").withIndex(5).ofType(Types.VARCHAR).withSize(64))
        addMetadata(scopeUrl, ColumnMetadata.named("scope_url").withIndex(6).ofType(Types.VARCHAR).withSize(255))
        addMetadata(scopeParams, ColumnMetadata.named("scope_params").withIndex(7).ofType(Types.VARCHAR).withSize(255))
        addMetadata(resourceOrder, ColumnMetadata.named("resource_order").withIndex(8).ofType(Types.INTEGER).withSize(10))
        addMetadata(permissionCode, ColumnMetadata.named("permission_code").withIndex(9).ofType(Types.VARCHAR).withSize(255))
        addMetadata(isUserRelation, ColumnMetadata.named("is_user_relation").withIndex(10).ofType(Types.INTEGER).withSize(10))
        addMetadata(isRoleRelation, ColumnMetadata.named("is_role_relation").withIndex(11).ofType(Types.INTEGER).withSize(10))
        addMetadata(isEnable, ColumnMetadata.named("is_enable").withIndex(12).ofType(Types.INTEGER).withSize(10))
        addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(13).ofType(Types.VARCHAR).withSize(64))
        addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(14).ofType(Types.TIMESTAMP).withSize(35).withDigits(6))
        addMetadata(updateBy, ColumnMetadata.named("update_by").withIndex(15).ofType(Types.VARCHAR).withSize(64))
        addMetadata(updateAt, ColumnMetadata.named("update_at").withIndex(16).ofType(Types.TIMESTAMP).withSize(35).withDigits(6))
    }
}

